#include <stdio.h>
#include <sys/ioctl.h>
#include <sys/types.h> 
#include <sys/stat.h>
#include <fcntl.h>
#include "key.h"

int main(void){

	int fd;
	fd = open("/dev/key2",O_RDWR);
	key_desc key;
	key.num = 2;
	key.flag = 1;
	while(1){
		key.flag = 1;
		ioctl(fd,KEY_CTL,&key);
		sleep(1);
		key.flag = 0;
		ioctl(fd,KEY_CTL,&key);
		sleep(1);
		key.num = 3;
		key.flag = 1;
		ioctl(fd,KEY_CTL,&key);
		sleep(1);
		key.flag = 0;
		ioctl(fd,KEY_CTL,&key);
		sleep(1);
		key.num = 4;
		key.flag = 1;
		ioctl(fd,KEY_CTL,&key);
		sleep(1);
		key.flag = 0;
		ioctl(fd,KEY_CTL,&key);
		sleep(1);
		key.num = 2;
	}





	return 0;
}






